-
Notifications
You must be signed in to change notification settings - Fork 7
Add flag to enable quiet mode (run without PR comments) #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
main.go
Outdated
| if !found { | ||
| err = a.client.AddComment(comment) | ||
| if !QUIET_MODE_TEST { | ||
| if len(unapprovedOwners) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend && here to avoid additional layer of nesting
|
Codeowners approval required for this PR: |
…of unapprovedReviewers
BakerNet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looking good!
README.md
Outdated
|
|
||
| ### Quiet Mode | ||
|
|
||
| You can run Codeowners Plus in a "quiet" mode using the `quiet` input in the GitHub Action or the `-quiet=true` flag in the CLI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can leave off the CLI flag detail - we only really talk about the use case in terms of the GHA. But add the flag to the CONTRIBUTING.md call
README.md
Outdated
| - @user2 | ||
| ``` | ||
|
|
||
| ### Quiet Mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't exactly in the right section - since this isn't a codeowners.toml config. But we don't have the right section atm. I think it would be good to have a "GHA Inputs" section where we talk about verbose and quiet
The README may be getting big enough that we should start thinking about collapsible sections or WIKI... but let's not worry about that in this PR
README.md
Outdated
|
|
||
| You can run Codeowners Plus in a "quiet" mode using the `quiet` input in the GitHub Action or the `-quiet=true` flag in the CLI. | ||
|
|
||
| **When Quiet Mode is Enabled:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer subheaders over bold with :
main_test.go
Outdated
| } | ||
| } | ||
|
|
||
| func TestAddReviewStatusComment_AddsComment(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you combine these into TestAddReviewStatusComment, TestAddOptionalComment, and TestRequestReviews with table-based tests rather than having separate tests for the different cases. See examples in codebase (grep tt :=) and styleguide/tests.md for example.
BTW, AI is pretty good at conversions like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You got it. Yeah this is better
the AI actually struggled at first - kind of par for the course for me, I had to do the first one by hand, fed it as example, and then it got the other 2 tables
BakerNet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one tiny change
Co-authored-by: Hans Baker <[email protected]>
Changes in owned files since last approval
Related PR(s)
Related Issue(s)
#5
Summary / Background
This PR adds a quiet mode to codeowners plus, which prevents the addition of comments to PRs and will not request reviews from unapproved owners. This feature should be especially useful for running codeowners on PR's that are still in draft status.
The readme is updated with info on what it does, and how to run in quiet mode.